]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/button: Ungrab device before calling st_button_release
authorJonas Dreßler <verdre@v0yd.nl>
Thu, 4 Jul 2019 15:33:06 +0000 (17:33 +0200)
committerJonas Dreßler <verdre@v0yd.nl>
Thu, 4 Jul 2019 16:25:15 +0000 (18:25 +0200)
Since priv->device gets set to NULL inside st_button_release, ungrab the
input device before calling st_button_release and avoid
clutter_input_device_ungrab failing with a critical error.

This fixes a regression introduced with
d5a1a888d91b9456632a8393cf14c443e6df6a5b

While at it, also remove the superfluous line resetting priv->device to
NULL and move the check for priv->grabbed into an elseif block since
there should be no case where StButton has both grabs at the same time.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/614

src/st/st-button.c

index fb7ccd80d8d3a6984c35237eb8619cc9e52de928..3897c7c87e327e3d5a7d790993358b2abbc95653 100644 (file)
@@ -779,18 +779,15 @@ st_button_fake_release (StButton *button)
       clutter_input_device_sequence_ungrab (priv->device,
                                             priv->press_sequence);
     }
-
-  if (priv->pressed || priv->press_sequence)
-    st_button_release (button, priv->device,
-                       priv->pressed, 0, NULL);
-
-  if (priv->grabbed)
+  else if (priv->grabbed)
     {
       priv->grabbed = 0;
       clutter_input_device_ungrab (priv->device);
     }
 
-  priv->device = NULL;
+  if (priv->pressed || priv->press_sequence)
+    st_button_release (button, priv->device,
+                       priv->pressed, 0, NULL);
 }
 
 /******************************************************************************/